<template>
	<view class="allOrder">
		<view class="allOrder-box" v-for="(item,index) in allList" :key="index">
			<view class="top">
				<image class="top-img" :src="item.img" mode=""></image>
				<text class="top-title">{{item.shopName}}</text>
				<text class="top-active" v-if="item.type==0">卖家已发货</text>
				<text class="top-active" v-if="item.type==1">卖家待发货</text>
				<text class="top-active" v-if="item.type==2">交易成功</text>
			</view>
			<view class="middle">
				<image class="middle-img" :src="item.shopImg" mode=""></image>
				<view class="middle-right">
					<text class="title">{{item.title}}</text>
					<text class="specs">{{item.specs}} <text class="num">{{item.num}}</text></text>
					<view class="middle-btn">
						<text class="shipping">免运费</text>
						<text class="shipping">私定精选</text>
					</view>
				</view>
			</view>
			<view class="bottom">
				<view class="inactive">
					实付积分：{{item.paidintegral}}
				</view>
				<view class="bottom-btn-box" v-if="item.type==0">
					<view class="bottom-btn" @click="received">
						订单详情
					</view>
					<view class="bottom-btn">
						查看物流
					</view>
					<view class="bottom-btn-active bottom-btn">
						确认收货
					</view>
				</view>
				<view class="bottom-btn-box" v-if="item.type==1">
					<view class="bottom-btn">
						订单详情
					</view>
					<view class="bottom-btn-active bottom-btn">
						催一催
					</view>
				</view>
				<view class="bottom-btn-box" v-if="item.type==2">
					<view class="bottom-btn">
						申请售后
					</view>
					<view class="bottom-btn-active bottom-btn">
						加入购物车
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				allList:[{
						img:require('../../../static/mine/shop/dianpu.png'),//店铺图片
						shopImg:require('../../../static/index/phone.png'),//商品图片
						type:0,//订单状态--0：已发货 1：待发货 2：交易成功
						shopName:'南极人洗手液',//店铺名称
						title:'植物护洗手液免洗漱75%酒洗漱75%酒',//订单描述
						specs:'免洗手凝胶80ml',//订单规格
						num:'3瓶',//商品数量
						paidintegral:'2700'//实付积分
				}
				]
			}
		},
		methods: {
			//已发货-订单详情
			received(){
				uni.navigateTo({
					url:'/myPackageA/mine/details/shipped'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.allOrder-box{
		margin-bottom: 34rpx;
		width: 100%;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 20rpx;
		display: flex;
		flex-direction: column;
		padding: 30rpx;
		.top{
			padding-bottom: 28rpx;
			display: flex;
			.top-img{
				width: 50rpx;
				height: 46rpx;
			}
			.top-title{
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #333333;
				margin-left: 12rpx;
			}
			.top-active{
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FF7200;
				margin-left: 160rpx;
			}
		}
		.middle{
			display: flex;
			.middle-img{
				width: 160rpx;
				height: 160rpx;
			}
			.middle-right{
				width: 450rpx;
				margin-left: 20rpx;
				display: flex;
				flex-direction: column;
				.title{
					font-size: 32rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #333333;
					//单行省略号
					white-space:nowrap;
					overflow:hidden;
					text-overflow:ellipsis;
				}
				.specs{
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
					margin: 20rpx 0;
					.num{
						margin-left: 20rpx;
					}
				}
				.middle-btn{
					display: flex;
					.shipping{
						padding: 5rpx 8rpx;
						height: 30rpx;
						line-height: 30rpx;
						text-align: center;
						background: #FFFFFF;
						border: 1px solid #FF7200;
						opacity: 1;
						border-radius: 8rpx;
						margin-right: 28rpx;
						font-size: 20rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #FF7200;
						display: flex;
						justify-content: center;
						align-items: center;
					}
				}
				
			}
		}
		.bottom{
			margin-top: 22rpx;
			.inactive{
				text-align: right;
			}
			.bottom-btn-box{
				display: flex;
				justify-content: flex-end;
				margin-top: 20rpx;
				.bottom-btn{
					padding: 5rpx 10rpx;
					height: 50rpx;
					line-height: 50rpx;
					text-align: center;
					background: #FFFFFF;
					border: 1px solid #707070;
					opacity: 1;
					display: flex;
					justify-content: center;
					align-items: center;
					border-radius: 20rpx;
					margin-right: 20rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #333333;
				}
				.bottom-btn-active{
					padding: 5rpx 10rpx;
					height: 50rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					text-align: center;
					background: #FFFFFF;
					border: 1px solid #FF7200;
					opacity: 1;
					border-radius: 20rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FF7200;
				}
			}
		}
	}
</style>
